package com.atguigu.yygh.hosp.controller;

import com.atguigu.yygh.common.utils.R;
import com.atguigu.yygh.hosp.service.DepartmentService;
import com.atguigu.yygh.vo.hosp.DepartmentVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/admin/hosp/department")
@Api(tags = "科室管理")

public class DepartmentController {

    @Autowired
    private DepartmentService departmentService;

    @ApiOperation("查询所有的科室")
    @GetMapping("/getList/{hoscode}")
    public R getList(@PathVariable String hoscode){

        List<DepartmentVo> list = departmentService.getList(hoscode);

        return R.ok().data("list",list);
    }

}
